﻿using UnityEngine;
using System.Collections.Generic;


public class MapConfigModel : ScriptableObject, System.ICloneable
{
    public List<GameObject> SideList { set; get; }
    public List<GameObject> SidePrefab { set; get; }
    public List<GameObject> MapStege { set; get; }
    public List<GameObject> ListPointTranfrom { set; get; }
    public List<string> MapID { set; get; }
    public List<Def.FightingType> ListFightingType { set; get; }
    public List<GameObject> MonsterPointPanel { set; get; }
    public List<GameObject> OtherGameObject { set; get; }
    public List<GameObject> OtherGameObjectPrefab { set; get; }
    public List<GameObject> MapPanel { set; get; }
    public List<bool> HideList { set; get; }
    public List<Def.MonsterSpawnEnum> ListMonsterSpawnEnum { set; get; }


    public void Remove(int index)
    {
        SideList.RemoveAt(index);
        MapStege.RemoveAt(index);
        ListPointTranfrom.RemoveAt(index);
        MapID.RemoveAt(index);
        ListFightingType.RemoveAt(index);
        MonsterPointPanel.RemoveAt(index);
        OtherGameObject.RemoveAt(index);
        MapPanel.RemoveAt(index);
        HideList.RemoveAt(index);
        SidePrefab.RemoveAt(index);
        OtherGameObjectPrefab.RemoveAt(index);
        ListMonsterSpawnEnum.RemoveAt(index);
    }



    public MapConfigModel()
    {
        SideList = new List<GameObject>();
        MapStege = new List<GameObject>();
        ListPointTranfrom = new List<GameObject>();
        MapID = new List<string>();
        ListFightingType = new List<Def.FightingType>();
        MonsterPointPanel = new List<GameObject>();
        OtherGameObject = new List<GameObject>();
        MapPanel = new List<GameObject>();
        HideList = new List<bool>();
        SidePrefab = new List<GameObject>();
        OtherGameObjectPrefab = new List<GameObject>();
        ListMonsterSpawnEnum = new List<Def.MonsterSpawnEnum>();
    }

    /// <summary>
    /// 新建一个空白小地图
    /// </summary>
    public void AddItem(string mapID, GameObject mapPanel, GameObject sidePanel, GameObject rolePoint, GameObject monsterPanel, GameObject otherPanel, GameObject newMapModel)
    {
        SideList.Add(sidePanel);
        MapStege.Add(newMapModel);
        ListPointTranfrom.Add(rolePoint);
        MapID.Add(mapID);
        ListFightingType.Add(Def.FightingType.Kill);
        MonsterPointPanel.Add(monsterPanel);
        OtherGameObject.Add(otherPanel);
        MapPanel.Add(mapPanel);
        HideList.Add(false);                    //显示
        SidePrefab.Add(null);
        OtherGameObjectPrefab.Add(null);
        ListMonsterSpawnEnum.Add(Def.MonsterSpawnEnum.Once);
    }

    public object Clone()
    {
        MapConfigModel clone = new MapConfigModel();
        clone.SideList = this.SideList;
        clone.MapStege = this.MapStege;
        clone.ListPointTranfrom = this.ListPointTranfrom;
        return clone;
    }


}

/// <summary>
/// 出怪组
/// </summary>
public class MonsterGrop
{
    /// <summary>
    /// 怪物组的 坐标信息
    /// </summary>
    public List<Vector3> listVector { set; get; }
    /// <summary>
    /// 怪物组id掉落组
    /// </summary>
    public List<int> DropMonsterID { set; get; }
    /// <summary>
    /// 当前组的怪物ID
    /// </summary>
    public List<int> MonsterID { set; get; }
    /// <summary>
    /// 触发器
    /// </summary>
    public GameObject Trigger { set; get; }
    /// <summary>
    /// 下组怪刷新时间
    /// </summary>
    public float SpwanInterval { set; get; }

    /// <summary>
    /// 是否循环使用刷怪点  一般用在无尽模拟式
    /// </summary>
    public bool IsLoops { set; get; }
}